//vuex全局变量
import Vue from 'vue'
import vuex from 'vuex'
// import { userInfo } from 'os';
Vue.use(vuex);


const mutations = {

    setUserInfo(state, userInfo) {
        state.userInfo = userInfo;
        sessionStorage.setItem('userInfo', JSON.stringify(state.userInfo))
    },
    setUserLogo(state, logo) {
        state.userInfo.logo = logo;
        sessionStorage.setItem('userInfo', JSON.stringify(state.userInfo))
    },
    setNotice(state, notice) {
        state.notice = notice;
    },
    setKeyWords(state, keyWords) {
        state.keyWords = keyWords;
    },
    setshare(state, share) {
        state.showShare = share;
    },
    setBatchList(state, list) {
        state.batchLit = list;
    },
    setDZNotice(state, flag) {
        if(flag==0){
            state.dzNotice = 0;
        }else{
            state.dzNotice++;
        }
        
    },
}
export default new vuex.Store({
    state: {
        userInfo: JSON.parse(sessionStorage.getItem('userInfo')) || {},
        notice: { msgCount: 0, shopCartCount: 0 },
        app: {
            showTab: false
        },
        keyWords: '',
        showShare: false,
        batchLit: [],
        dzNotice: 0,
        d_cd: [{ name: "不限", key: "01", sel: false }, { name: "山东", key: "20", sel: false }, { name: "江苏", key: "11", sel: false },{name:"安徽",key:"14",sel:false},{ name: "河南", key: "21", sel: false }
        , { name: "河北", key: "22", sel: false },{ name: "湖南", key: "17", sel: false },{ name: "湖北", key: "16", sel: false },
          { name: "江西", key: "18", sel: false }, { name: "山西", key: "23", sel: false }, { name: "天津", key: "24", sel: false },   { name: "甘肃", key: "25", sel: false }],
        j_cd: [{ name: "美国", key: "51", sel: false }, { name: "澳洲", key: "52", sel: false }, { name: "印度", key: "53", sel: false },
        { name: "墨西哥", key: "54", sel: false }, { name: "巴西", key: "55", sel: false }, { name: "希腊", key: "56", sel: false },
        { name: "西班牙", key: "57", sel: false }, { name: "乌棉", key: "58", sel: false }, { name: "中亚棉", key: "59", sel: false },
        { name: "西非", key: "60", sel: false },{ name: "南非", key: "85", sel: false }, { name: "埃及", key: "61", sel: false }, { name: "巴基斯坦", key: "81", sel: false }, { name: "坦桑尼亚", key: "82", sel: false }, { name: "阿根廷", key: "83", sel: false }, { name: "其他", key: "99", sel: false }],
        z_mz1: ["不限", "2.5", "2.8", "3.0", "3.5", "3.6", "3.7", "3.8", "3.9", "4.0", "4.1", "4.2", "4.3", "4.4", "4.5", "5.0"],
        z_mz2: ["不限", "3.5", "3.8", "3.9", "4.0", "4.1", "4.2", "4.3", "4.4", "4.5", "4.6", "4.7", "4.8", "4.9", "5.0", "5.1",  "5.2", "5.3" ,"5.3-","5.3+"],
        //s_jkjhd:[{name:"美国",key:"1",sel:false},{name:"澳洲",key:"2",sel:false},{name:"印度",key:"3",sel:false},{name:"墨西哥",key:"4",sel:false},{name:"巴西",key:"5",sel:false},{name:"希腊",key:"6",sel:false},{name:"西班牙",key:"7",sel:false},{name:"乌棉",key:"8",sel:false},{name:"中亚棉",key:"9",sel:false},{name:"西非",key:"10",sel:false},{name:"埃及",key:"11",sel:false},{name:"其他",key:"12",sel:false}],
        s_jhd2:[{name:"不限",key:"10",sel:false},{name:"山东",key:"20",sel:false},{name:"江苏",key:"11",sel:false},{name:"安徽",key:"14",sel:false},{name:"浙江",key:"13",sel:false}
        ,{name:"河南",key:"21",sel:false},{name:"河北",key:"22",sel:false}
        ,{name:"湖南",key:"17",sel:false},{name:"湖北",key:"16",sel:false}
        ,{name:"福建",key:"15",sel:false},{name:"江西",key:"18",sel:false},{name:"山西",key:"23",sel:false},{name:"天津",key:"24",sel:false}],
        p_cd: [{name:"不限",key:"60",sel:false},{name:"新疆",key:"1",sel:false},{name:"地产",key:"2",sel:false}],
        bt_cd:[{name:"不限",key:"60",sel:false},{name:"农一师",key:"1",sel:false},{name:"农二师",key:"2",sel:false},{name:"农三师",key:"3",sel:false},{name:"农四师",key:"4",sel:false},{name:"农五师",key:"5",sel:false},{name:"农六师",key:"6",sel:false},{name:"农七师",key:"7",sel:false},{name:"农八师",key:"8",sel:false},{name:"农九师",key:"9",sel:false},{name:"农十师",key:"10",sel:false},{name:"农十一师",key:"11",sel:false},{name:"农十二师",key:"12",sel:false},{name:"农十三师",key:"13",sel:false},{name:"农十四师",key:"14",sel:false}]

    },
    mutations: mutations
})